package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SupSupplierInventoryMapper;
import com.ruoyi.system.domain.SupSupplierInventory;
import com.ruoyi.system.service.ISupSupplierInventoryService;

/**
 * 供货商存货对照Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-20
 */
@Service
public class SupSupplierInventoryServiceImpl implements ISupSupplierInventoryService 
{
    @Autowired
    private SupSupplierInventoryMapper supSupplierInventoryMapper;

    /**
     * 查询供货商存货对照
     * 
     * @param relationId 供货商存货对照主键
     * @return 供货商存货对照
     */
    @Override
    public SupSupplierInventory selectSupSupplierInventoryByRelationId(Long relationId)
    {
        return supSupplierInventoryMapper.selectSupSupplierInventoryByRelationId(relationId);
    }

    /**
     * 查询供货商存货对照列表
     * 
     * @param supSupplierInventory 供货商存货对照
     * @return 供货商存货对照
     */
    @Override
    public List<SupSupplierInventory> selectSupSupplierInventoryList(SupSupplierInventory supSupplierInventory)
    {
        return supSupplierInventoryMapper.selectSupSupplierInventoryList(supSupplierInventory);
    }

    /**
     * 新增供货商存货对照
     * 
     * @param supSupplierInventory 供货商存货对照
     * @return 结果
     */
    @Override
    public int insertSupSupplierInventory(SupSupplierInventory supSupplierInventory)
    {
        supSupplierInventory.setCreateTime(DateUtils.getNowDate());
        return supSupplierInventoryMapper.insertSupSupplierInventory(supSupplierInventory);
    }

    /**
     * 修改供货商存货对照
     * 
     * @param supSupplierInventory 供货商存货对照
     * @return 结果
     */
    @Override
    public int updateSupSupplierInventory(SupSupplierInventory supSupplierInventory)
    {
        supSupplierInventory.setUpdateTime(DateUtils.getNowDate());
        return supSupplierInventoryMapper.updateSupSupplierInventory(supSupplierInventory);
    }

    /**
     * 批量删除供货商存货对照
     * 
     * @param relationIds 需要删除的供货商存货对照主键
     * @return 结果
     */
    @Override
    public int deleteSupSupplierInventoryByRelationIds(Long[] relationIds)
    {
        return supSupplierInventoryMapper.deleteSupSupplierInventoryByRelationIds(relationIds);
    }

    /**
     * 删除供货商存货对照信息
     * 
     * @param relationId 供货商存货对照主键
     * @return 结果
     */
    @Override
    public int deleteSupSupplierInventoryByRelationId(Long relationId)
    {
        return supSupplierInventoryMapper.deleteSupSupplierInventoryByRelationId(relationId);
    }
}
